package com.google.code.chaotic.model;

import java.io.Serializable;

import javax.jdo.annotations.EmbeddedOnly;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

//

@PersistenceCapable
@EmbeddedOnly
public class LatLon implements Serializable {

	/** @uml.property name="latitude" */
	@Persistent
	private double latitude;

	/** @uml.property name="longitude" */
	@Persistent
	private double longitude;

	//

	public LatLon() {
	}

	public LatLon(double lat, double lon) {
		latitude = lat;
		longitude = lon;
	}

	/** @uml.property name="latitude" */
	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	/** @uml.property name="latitude" */
	public double getLatitude() {
		return latitude;
	}

	/** @uml.property name="longitude" */
	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	/** @uml.property name="longitude" */
	public double getLongitude() {
		return longitude;
	}

	@Override
	public String toString() {
		return String.format(//
				"(lon.: %1$f, lat.: %2$f)", //
				longitude, latitude);
	}
}
